# event card functions

# Choice Function:  Gives the input player a choice, which is results in one of several lists of results.  The result list itself may be a list of further event functions.

def choice(player,results):

    # Prompt input player to choose between the number of result choices:
    # Send back to main loop to resolve result?

# resource function: alter the input board element type by the input value
def resource(category,value):

    board['resource'][category]['current'] += value

    # If input resource exceeds maximum, set as maximum
    if board['resource'][category]['current'] > board['resource'][category]['high']:
        board['resource'][category]['current'] = board['resource'][category]['high']
        return

    # If input resource below zero, set as zero
    elif board['resource'][category]['current'] < 0:
        board['resource'][category]['current'] = 0        
##        endOfGameCheck()
        return

# skills function:  alter the input 'player's (or 'all' for all players)
# skill cards by the input 'value' (or 'all' for all cards),
# for the input 'category' (or 'any for player choice, or 'random' for random choice)
def skills(player,category,value):


# loyalty function:  allows the input 'viewer'
# to view the input random 'value' of loyalty cards from the input 'player'



# title function:  assign input 'title' to input 'player' (or gives input player choice of who to give title to, if input has _choice appended to it)


# move function:  move input player (or players at location) to input location
# also, "current_choice" allows current player to move a player of choice to input location


# basestars function:  cause basestars to take input action
##                function='basestars',
##                arguments=dict(action='raiders')
##                arguments=dict(action='nukes')
##                arguments=dict(action='heavies')

# raiders function:  cause raiders to activate


# heavies function:  cause heavy raiders to activate


# jump function:  cause jump prep to move (and resolve) by input 'value'
#                jump(value=+1) or jump(value='now') for emergency jump if prep is on last one or two levels.
# (calling function must prevent jump function if prep not far enough along)
# If emergency jump, roll for population loss according to current jump prep status.
# Also, if 'pursuit' is 'enabled',
#  then shuffle event 'thirty-three' into the 'event_deck' from the 'in_play_deck'
# Also, set 'pilot_training' to 'good'
# Also, set 'massive_deployment' to 'inactive'


# ships function:  cause number of input 'value'
# of input 'category' of ship at input "from" location, 'loc_from',
# to be moved to input "to" location, 'loc_to'.
# Also, if 'basestar' or 'civilian' moves to 'destroyed',
# and 'pursuit' is 'enabled', then <pursuit(status='disable')>


# nukes function:  perform input action on nuke stores by input value


# Challenge function:  prompt players in turn to select cards for the challenge.


# Boarding function:  add input 'value' boarders to start of boarding track,
# and move existing boarders up 1 if input 'activate'=True.


# Sabotage function:  indicates cylon detector is 'damaged',
# which prevents any player from looking at another player's loyalty cards.
# Or indicates it is working, or 'good'.  Stored in game data under cylon_detector.
# arguments:  status='damaged'
# arguments:  status='good'


# Roll function:  if 1d8 roll is equal to or lower than the input "threshold", then do input effect.


# Crisis function:  draws and resolves a crisis card.


# Pursuit function:  input 'status' enables or disables "relentless pursuit",
# which adds the 'thirty-three' event card back into the event deck after it is resolved.

# Shuffle function:  shuffles input 'event' card into the deck.


# Jamming function:  input 'status' indicates 'jammed',
# in which case the 'communications' game value (and location) is in-operative,
# Or indicates 'good', in which case the communications location is operative.


# Communications Space function:  perform the Comms action from the comms space on the board.
# Also, check if 'communications' are 'jammed' or 'good' as a prerequisite for using the action.


# Training function:  if input 'status' is 'training', then update 'pilot_training' to 'training',
# and then all unmanned vipers have -2 attack rolls.
# if 'status' is 'good', update to 'good', then no penalty.


# Viper Attack function:  perform the Viper attack action on the input 'target category',
# and resolve according to appropriate hit chart.
# Also, check and apply a penalty as necessary for the 'pilot_training' status.


# Massive Deployment function:  input 'status' to 'active' or 'inactive'
# if 'active', +1 ship to basestar launch actions
# resets on fleet 'jump'.
